All experiments implemented the following paradigm

Rhodamine B isothiocyanate dextran dye (Sigma, R9379 10 or 70 kDA) was dissolved in saline at a concentration of 10 mg/mL. 100 μl was injected retro-orbitally under light isoflurane anesthesia. Following 10 minutes anesthesia recovery, fiber photometry collection was started. 100 μl was injected retro-orbitally under light isoflurane anesthesia. Animals were quickly mounted to a head-bar bracket while under anesthesia and allowed to recover from anesthesia for 10 minutes prior to imaging. For COX-2 inhibition, the experiments were repeated with I.P. injection of either saline (vehicle), or ibuprofen (100 mg/kg in saline)30 minutes prior to rhodamine dye injection-based blood volume monitoring. Photometric recording of rhodamine signal was fit with an exponential using the following functions

def exp_decay_func(x, a, k, b):
    return a * np.exp(-k*x) + b


def lin_decay_func(x, m, b):
    return m * x + b


def remove_exp_decay(data):
    # assumes linear x and 2D data of trials from continuous recording

    x = np.linspace(0, len(data), len(data))
    y = data
    p0 = (1, 0, 1) # starting search koefs
    opt, pcov = curve_fit(exp_decay_func, x, y, p0, maxfev=1200)
    a, k, b = opt
    # test result
    fit_x = np.linspace(0, len(data), len(data))
    fit_y = exp_decay_func(fit_x, a, k, b)

    return fit_y